Quiz 2: 14th of October
Exam I: 21st of October

Practice makes perfect

- Built-in data structures:
Collection (Interface)
Descendants of Collection: List, Set, Queue

- LinkedList implements List
Example#1: Linked List Demo

- Set: ---> HashSet and TreeSet
An interface in Java is also known as an abstract data type

HashSet vs TreeSet: the elements in a TreeSet are sorted

Example#2: Removing duplicates

With sets --> running time of seach drops to O(1) time

- Map: Collection of key/value pairs
HashMap and TreeMap ---> The keys are sorted in a treemap

In a Map, the key is unique

Objective: Count the number of occurrences of every word in a given input line of text

the quick brown fox jumps over the lazy dog

the: 2

If the Map is called dictionary: dictionary.put("the", count+1)

Example#3: Concordances










 

